<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="cxtx" uri="/WEB-INF/tld/cxtx.tld"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<script type="text/javascript">
    var $busiVehicle_update = new Object();

    $(function() {

        $busiVehicle_update.save = function($dialog){
            $('#an_car_form').form('submit',{
                onSubmit:function(){
                    //return $(this).form('enableValidation').form('validate');
                    if($(this).form('enableValidation').form('validate')){
                        $("#btn_an_car_update").linkbutton("disable");
                        return true;
                    }else{
                        return false;
                    }
                },
                success:function(data){
                    var an_car_form = $('#an_car_form');
                    $.post('${ctx}/an/car/update?_m=exec&r='+Math.random(), an_car_form.formSerialize(), function(json) {
                        if(statusMsg(json)){
                            $.messager.alert("提示","保存成功！","info",function(){
                                viewDialog.dialog('destroy');
                                $busiVehicle_list.reload();
                            });
                        }else{
                            $("#btn_an_car_update").linkbutton("enable");
                        }
                    }, "JSON");
                }
            });
        };

    });
</script>
<div class="form-box">
    <div class="form-body">
        <form role="form" name="an_car_form" id="an_car_form" class="easyui-form form form-horizontal" data-options="novalidate:true">
            <input type="hidden" id="carId" name="carId" value="${anCarEntity.carId}"/>

            <div class="seg-title">
                <div class="seg-title-box">
                    <ul>
                        <li class="seg-title-box-icon" ><img src="${ctx }/assets/images/communication.gif"/></li>
                        <li class="seg-title-box-text">基本信息</li>
                    </ul>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    <p class="label-txt">app用户ID：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="appUserId" name="appUserId" value="${anCarEntity.appUserId}"  class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,36]">
                </div>
                <label class="col-sm-2 control-label">
                    <p class="label-txt">车牌号：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="plateNo" name="plateNo" value="${anCarEntity.plateNo}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,20]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    <p class="label-txt">发动机号：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="engineNo" name="engineNo" value="${anCarEntity.engineNo}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,36]">
                </div>
                <label class="col-sm-2 control-label">
                    <p class="label-txt">车架号：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="carVin" name="carVin" value="${anCarEntity.carVin}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,20]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    <p class="label-txt">排气量：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="displacement" name="displacement" value="${anCarEntity.displacement}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,36]">
                </div>
                <label class="col-sm-2 control-label">
                    <p class="label-txt">品牌：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="brandCode" name="brandCode" value="${anCarEntity.brandCode}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,20]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    <p class="label-txt">型号：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <!--easyui combobox-->
                    <input type="text" id="modelCode" name="modelCode" value="${anCarEntity.modelCode}" class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;" data-options="valueField: 'code',textField: 'name',url:'${ctx}/tcode/all/method?method=getCacheCdRoleType',editable:false" required="required">
                    <!--自定义标签-->
                    <cxtx:dm_select name="test" id="test" cssClass="form-control easyui-combobox" code="getCacheCdRoleType" first="" style="width:100%;height:34px;line-height:34px;"
                                  zdyContent=" panelHeight=\"300px\"   data-options=\"valueField: 'code',textField: 'name',editable:false\" ">
                    </cxtx:dm_select>
                    <!--自定义函数 返回代码名称-->
                    ${cxtx:getCodeName( "getCacheCdRoleType", anCarEntity.modelCode)}
                </div>
                <label class="col-sm-2 control-label">
                    <p class="label-txt">车辆类型：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="carType" name="carType" value="${anCarEntity.carType}" class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;" required="required" data-options="
                    valueField: 'label',
                    textField: 'value',
                    data: [{
                        label: '01',
                        value: '小型车'
                    },{
                        label: '02',
                        value: '大型车'
                    }],editable:false" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    <p class="label-txt">使用性质：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="useType" name="useType" value="${anCarEntity.useType}" class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;" required="required" data-options="
                    valueField: 'label',
                    textField: 'value',
                    data: [{
                        label: '1',
                        value: '营运'
                    },{
                        label: '2',
                        value: '非营运'
                    }],editable:false" />
                </div>
                <label class="col-sm-2 control-label">
                    <p class="label-txt">是否默认：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="isDefault" name="isDefault" value="${anCarEntity.isDefault}" class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;" required="required" data-options="
                    valueField: 'label',
                    textField: 'value',
                    data: [{
                        label: '1',
                        value: '是'
                    },{
                        label: '2',
                        value: '否'
                    }],editable:false" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    <p class="label-txt">初次登记日期：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">

                    <input type="text" id="recordDate" name="recordDate" value="<fmt:formatDate value="${anCarEntity.recordDate}" pattern="yyyy-MM-dd"/>" data-options="editable:false" class="form-control easyui-datebox" style="width:100%;height:34px;line-height:34px;" required="required">
                </div>
                <label class="col-sm-2 control-label">
                    <p class="label-txt">核定载客数：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="approvedNumber" name="approvedNumber" value="${anCarEntity.approvedNumber}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    <p class="label-txt">车主姓名：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="ownerName" name="ownerName" value="${anCarEntity.ownerName}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required">
                </div>
                <label class="col-sm-2 control-label">
                    <p class="label-txt">车主身份号：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-3">
                    <input type="text" id="ownerCard" name="ownerCard" value="${anCarEntity.ownerCard}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required">
                </div>
            </div>
        </form>
    </div>
</div>
